<header class="header navbar bg-white shadow">
  <div class="btn-group tool-button">
    <a class="btn btn-primary navbar-btn" href="/private/shop/member/member" data-pjax><i class="ti-angle-left"></i> 返回</a>
  </div>
</header>

<div class="content-wrap">
  <div class="wrapper" style="min-height:500px;">
    <section class="panel panel-form">
      <form id="addForm" role="form" class="form-horizontal parsley-form" data-parsley-validate
            action="/private/shop/member/member/addDo" method="post">
        <div class="row mb10">
          <div class="col-lg-12">
            <div class="form-group">
              <label for="login_name" class="col-sm-2 control-label">用户名</label>

              <div class="col-sm-8">
                <input type="text" id="login_name" class="form-control" name="login_name" data-parsley-required="true"
                       placeholder="用户名/手机号" data-parsley-minlength="4" data-parsley-maxlength="100">
              </div>
            </div>
            <div class="form-group">
              <label for="nickname" class="col-sm-2 control-label">昵称</label>

              <div class="col-sm-8">
                <input type="text" id="nickname" class="form-control" name="nickname" data-parsley-required="true"
                       placeholder="昵称">
              </div>
            </div>
            <div class="form-group">
              <label for="mobile" class="col-sm-2 control-label">手机号码</label>

              <div class="col-sm-8">
                <input type="text" id="mobile" class="form-control" name="mobile" data-parsley-required="true"
                       placeholder="手机号码" data-parsley-phone maxlength="11">
              </div>
            </div>
            <div class="form-group">
              <label for="login_password" class="col-sm-2 control-label">密码</label>

              <div class="col-sm-8">
                <input type="text" id="login_password" class="form-control" name="login_password" data-parsley-required="true"
                       placeholder="密码"  data-parsley-minlength="6" data-parsley-maxlength="20">
              </div>
            </div>
            <div class="form-group">
              <label for="login_password2" class="col-sm-2 control-label">确认密码</label>

              <div class="col-sm-8">
                <input type="text" id="login_password2" class="form-control" name="login_password2" data-parsley-required="true"
                       placeholder="确认密码" data-parsley-equalto="#login_password"
                       data-parsley-equalto-message="两次密码输入不一致">
              </div>
            </div>
            <div class="form-group">
              <label for="lv_id" class="col-sm-2 control-label">会员等级</label>

              <div class="col-sm-8">
                <select id="lv_id" name="lv_id" class="form-control" >
                  <option value="0">无</option>
                  <%lvList.forEach(function(o){%>
                  <option value="<%=o.id%>"><%=o.name%></option>
                  <%});%>
                </select>
              </div>
            </div>
          </div>
        </div>
        <div class="col-lg-3"></div>
        <div class="col-lg-6">
          <div class="form-group text-center">
            <label></label>

            <div>
              <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="正在提交...">提 交</button>
            </div>
          </div>
        </div>
      </form>
    </section>

  </div>
</div>
<script language="JavaScript">
  $(document).ready(function () {
    $('#addForm').ajaxForm({
      dataType: 'json',
      beforeSubmit: function (arr, form, options) {
        form.find("button:submit").button("loading");
      },
      success: function (data, statusText, xhr, form) {
        if (data.code == 0) {
          Toast.success(data.msg);
          //刷新父级菜单
          form.resetForm();
        } else {
          Toast.error(data.msg);
        }
        form.find("button:submit").button("reset");
      }
    });
  });
</script>
